<!DOCTYPE HTML>
<html lang="en">
<head>
<title>IsFunc() - Syntax &amp; Usage | AutoHotkey</title>
<meta name="description" content="The IsFunc function returns a non-zero number if the specified function exists in the script." />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>IsFunc() <span class="ver">[v1.0.48+]</span></h1>

<p>Returns a non-zero number if the specified function exists in the script.</p>

<pre class="Syntax">MinParamsPlus1 := <span class="func">IsFunc</span>(FunctionName)</pre>
<h2>Parameters</h2>
<dl>

  <dt>FunctionName</dt>
  <dd><p>The name of the function whose minimum number of parameters is retrieved. <em>FunctionName</em> must exist explicitly in the script. In <span class="ver">[v1.1.00+]</span>, <em>FunctionName</em> can be a <a href="../Objects.htm#Function_References">function reference</a> instead of a name.</p></dd>

</dl>

<h2>Return Value</h2>
<p>This function returns one plus the minimum number of parameters (e.g. 1 for a function that requires zero parameters, 2 for a function that requires 1 parameter, etc.). If <em>FunctionName</em> does not exist explicitly in the script (by means such as <a href="_Include.htm">#Include</a> or a non-dynamic call to a <a href="../Functions.htm#lib">library function</a>), it returns 0.</p>

<h2>Related</h2>
<p><a href="../Functions.htm#DynCall">Dynamically Calling a Function</a>, <a href="../Objects.htm#Function_References">Function References</a>, <a href="../objects/Func.htm">Func Object</a>, <a href="Func.htm">Func()</a>, <a href="../Variables.htm#ThisFunc">A_ThisFunc</a></p>
<h2>Examples</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>count := IsFunc("RegExReplace") <em>; Any function name can used here.</em>
if count
    MsgBox, % "This function exists and has " count-1 " mandatory parameters."
else
    MsgBox, % "This function does not exist."</pre>
</div>

</body>
</html>
